#include <stdio.h>
int main(void)
{
    int a = 0, b = 0;
    scanf("%d %d", &a, &b);
    // 比较a和b的值并交换
    int *p1, *p2;
    printf("log: Addresses of variables:\n");
    printf("log: &a = %p, &b = %p\n", &a ,&b);
    printf("log: &p1 = %p, &p2 = %p\n", &p1, &p2);
    p1 = &a; p2 = &b; // 获取地址
    printf("log: p1 = %p, p2 = %p\n", p1, p2);
    if (*p1 > *p2)
    {   // 如果*p1比*p2大，交换
        int tmp = *p1;
        printf("log: step 1, a = %d, b = %d\n", a, b);
        *p1 = *p2;
        printf("log: step 1, a = %d, b = %d\n", a, b);
        *p2 = tmp;
        printf("log: step 1, a = %d, b = %d\n", a, b);
    }
    // 变量a和b的值已经被改变
    printf("%d %d\n", a, b);
    return 0;
}